package com.ruoyi.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.service.OrderRegisterWeChatRecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

/**
 * 微信对账
 */
@RestController
@RequestMapping("/hotel/order/registerWeChatRec")
public class OrderRegisterWeChatRecController extends BaseController {

    @Autowired
    OrderRegisterWeChatRecService orderRegisterWeChatRecService;

    /**
     * 查询微信对账数据
     * @param map
     * @return
     */
    @GetMapping("/getWeChatRecList")
    public AjaxResult getWeChatRecList(@RequestParam Map map) {
        return AjaxResult.success(orderRegisterWeChatRecService.getWeChatRecList(map));
    }

    /**
     * 根据id查询微信对账数据
     * @param id
     * @return
     */
    @GetMapping("/getWeChatRecById")
    public AjaxResult getWeChatRecById(@RequestParam String id) {
        return success(orderRegisterWeChatRecService.getWeChatRecById(id));
    }

    /**
     * 编辑微信对账数据
     * @param map
     * @return
     */
    @PostMapping("/postEditWeChatRec")
    public AjaxResult postEditWeChatRec(@RequestBody Map map) {
        return orderRegisterWeChatRecService.postEditWeChatRec(map);
    }

    /**
     * 新增微信对账数据
     * @param map
     * @return
     */
    @PostMapping("/postAddWeChatRec")
    public AjaxResult postAddWeChatRec(@RequestBody Map map) {
        return toAjax(orderRegisterWeChatRecService.postAddWeChatRec(map));
    }

    /**
     * 取消确认对账
     * @param map
     * @return
     */
    @PostMapping("/postCancelSeal")
    public AjaxResult postCancelSeal(@RequestBody Map map){
        return orderRegisterWeChatRecService.postCancelSeal(map);
    }

    /**
     * 确认对账
     * @param map
     * @return
     */
    @PostMapping("/postConfirmSeal")
    public AjaxResult postConfirmSeal(@RequestBody Map map){
        return orderRegisterWeChatRecService.postConfirmSeal(map);
    }
}
